package com.aegean.CommercialHotelBookSystem.shop.business.Impl;

import java.util.ArrayList;
import java.util.List;

import com.aegean.CommercialHotelBookSystem.factory.DaoFactory;
import com.aegean.CommercialHotelBookSystem.model.Customer;
import com.aegean.CommercialHotelBookSystem.model.Hotel;
import com.aegean.CommercialHotelBookSystem.model.Room;
import com.aegean.CommercialHotelBookSystem.room.dao.IRoomDao;
import com.aegean.CommercialHotelBookSystem.shop.business.IShopBusiness;
import com.aegean.CommercialHotelBookSystem.shop.dao.IShopDao;

public class ShopBusinessImpl implements IShopBusiness {

	@Override
	public List<Room> hotelValue() {
		IShopDao dao = DaoFactory.createShopDao();
		return dao.hotelValue();
	}

	@Override
	public List<Hotel> hotelClick() {
		IShopDao dao = DaoFactory.createShopDao();
		return dao.hotelClick();
	}

	@Override
	public List<Room> searchHotelRooms(int Hotel_Id, String room_Type,
			String room_Date) {
		IShopDao dao = DaoFactory.createShopDao();
		return dao.searchHotelRooms(Hotel_Id, room_Type, room_Date);
	}

	@Override
	public List<Room> searchHotelRooms2(String hotel_Name) {
		// TODO Auto-generated method stub
		IShopDao dao = DaoFactory.createShopDao();
		return dao.searchHotelRooms2(hotel_Name);
	}

	@Override
	public List<Room> searchShopRooms(int intpage, int intpagesize,
			String room_Type, String room_Date) {
		IShopDao shopdao = DaoFactory.createShopDao();
		List<Room> rooms = shopdao.searchShopRooms(room_Type, room_Date,
				intpage, intpagesize);
		return rooms;
	}

	@Override
	public int searchShopRoomsCount(String room_Type, String room_Date,
			int intpagesize) {
		IShopDao shopdao = DaoFactory.createShopDao();
		int introwcount = shopdao.searchShopRoomsCount(room_Type, room_Date);
		int intpagecount = (introwcount + intpagesize - 1) / intpagesize;
		return intpagecount;
	}

	@Override
	public boolean addOrder(ArrayList<Room> books, Customer customer) {
		IShopDao shopdao = DaoFactory.createShopDao();
		return shopdao.addOrder(books, customer);
	}

	@Override
	public boolean clickHotel(String Hotel_Id) {
		IShopDao shopdao = DaoFactory.createShopDao();
		return shopdao.clickHotel(Hotel_Id);
	}

	@Override
	public boolean clickRoom(String room_Id) {
		IShopDao shopdao = DaoFactory.createShopDao();
		return shopdao.clickRoom(room_Id);
	}
}
